#include <iostream>

using namespace std;
//多态
class vehicle{
public:
    virtual void showinfo()
    {
        cout<<"vehicle"<<endl;
    }
};

class car:public vehicle{
public:
    void showinfo()
    {
        cout<<"car"<<endl;
    }
};

class truck:public vehicle{
public:
    void showinfo()
    {
        cout<<"truck"<<endl;
    }
};

class boat:public vehicle{
public:
    void showinfo()
    {
        cout<<"boat"<<endl;
    }
};
int main()
{
    //cout << "Hello World!" << endl;
    vehicle data;
    car data2;
    truck data3;
    boat data4;

    data.showinfo();
    data2.showinfo();
    data3.showinfo();
    data4.showinfo();
    return 0;
}
